//app.js
var config = require("./utils/config.js");
var network = require("./utils/network.js");
App({
  onLaunch: function () {
    var that = this;
    wx.login({
      success: res => {
        wx.request({
          url: config.host +'api_login/login',
          method:"POST",
          data: {
            code: res.code
          },
          success: res => {
            console.log(res.data)
            wx.setStorageSync('openid', res.data.data.openid);
            wx.setStorageSync('session_key', res.data.data.session_key);
          }
        })
      }
    })
  },
  globalData: {
    userInfo: null,
    currenttab:null,
    cleaner:null,
    url:'https://www.xameijia.com'
  }
})